package com.hn.vue.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * hanni
 * 2019/3/7 0007
 * 19:34
 */
@RestController
@RequestMapping("/dept")
public class DeptController {

    @PreAuthorize("hasAuthority('sys:dept:list')")//基于权限标识符来获取
    @GetMapping("/list")
    public String list(){

        return "list";
    }

    @PreAuthorize("hasAuthority('sys:dept:add')")//基于权限标识符来获取
    @GetMapping("/add")
    public String add(){

        return "add";
    }

    @PreAuthorize("hasAuthority('sys:dept:delete')")//基于权限标识符来获取
    @GetMapping("/delete")
    public String delete(){

        return "delete";
    }

    @PreAuthorize("hasAuthority('sys:dept:update')")//基于权限标识符来获取
    @GetMapping("/update")
    public String update(){

        return "update";
    }

}
